# from modelscope import pipeline
from modelscope.preprocessors.nlp.space.tokenizer import BertTokenizer
from transformers import BertModel, pipeline

# bert = BertModel.from_pretrained(r"D:\aiproject\bert-base-chinese", return_dict=False)
# print(bert)
model_dir = "D:/aiproject/bert-base-chinese"
pp = pipeline(model=model_dir,task="fill-mask")
print(pp("马斯克从[MASK]就对科学技术十分痴迷"))

BertTokenizer